﻿using Core;
using Core.Domain.Seo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Services.Seo
{
    /// <summary>
    /// URL记录服务接口
    /// </summary>
    public partial interface IUrlRecordService
    {
        /// <summary>
        /// 删除
        /// </summary>
        void DeleteUrlRecord(UrlRecord urlRecord);

        /// <summary>
        /// 得到实体
        /// </summary>
        UrlRecord GetUrlRecordById(int urlRecordId);

        /// <summary>
        /// 插入实体
        /// </summary>
        void InsertUrlRecord(UrlRecord urlRecord);

        /// <summary>
        /// 更新实体
        /// </summary>
        void UpdateUrlRecord(UrlRecord urlRecord);

        /// <summary>
        /// 查询实体
        /// </summary>
        /// <param name="slug">Slug</param>
        /// <returns>Found URL record</returns>
        UrlRecord GetBySlug(string slug);


        /// <summary>
        /// 获取所有的实体
        /// </summary>
        /// <param name="slug">关键字</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">页大小</param>
        IPagedList<UrlRecord> GetAllUrlRecords(string slug, int pageIndex, int pageSize);


        string GetActiveSlug(int entityId, string entityName);

        /// <summary>
        /// 保存
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="entity"></param>
        /// <param name="slug"></param>
        void SaveSlug<T>(T entity, string slug) where T : BaseEntity;
    }
}
